3.455 \(\int \cot (e+f x) (a+b \sec ^3(e+f x)) \, dx\)

Optimal. Leaf size=54 \[ \frac {(a+b) \log (1-\cos (e+f x))}{2 f}+\frac {(a-b) \log (\cos (e+f x)+1)}{2 f}+\frac {b \sec (e+f x)}{f} \]

[Out]

1/2*(a+b)*ln(1-cos(f*x+e))/f+1/2*(a-b)*ln(1+cos(f*x+e))/f+b*sec(f*x+e)/f

________________________________________________________________________________________

Rubi [A]  time = 0.07, antiderivative size = 54, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {4138, 1802} \[ \frac {(a+b) \log (1-\cos (e+f x))}{2 f}+\frac {(a-b) \log (\cos (e+f x)+1)}{2 f}+\frac {b \sec (e+f x)}{f} \]

Antiderivative was successfully verified.

[In]

Int[Cot[e + f*x]*(a + b*Sec[e + f*x]^3),x]

[Out]

((a + b)*Log[1 - Cos[e + f*x]])/(2*f) + ((a - b)*Log[1 + Cos[e + f*x]])/(2*f) + (b*Sec[e + f*x])/f

Rule 1802

Int[(Pq_)*((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*Pq*(a + b*x
^2)^p, x], x] /; FreeQ[{a, b, c, m}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

Rule 4138

Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*tan[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> Module[{ff =
 FreeFactors[Cos[e + f*x], x]}, -Dist[(f*ff^(m + n*p - 1))^(-1), Subst[Int[((1 - ff^2*x^2)^((m - 1)/2)*(b + a*
(ff*x)^n)^p)/x^(m + n*p), x], x, Cos[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[(m - 1)/2] &&
IntegerQ[n] && IntegerQ[p]

Rubi steps

\begin {align*} \int \cot (e+f x) \left (a+b \sec ^3(e+f x)\right ) \, dx &=-\frac {\operatorname {Subst}\left (\int \frac {b+a x^3}{x^2 \left (1-x^2\right )} \, dx,x,\cos (e+f x)\right )}{f}\\ &=-\frac {\operatorname {Subst}\left (\int \left (\frac {-a-b}{2 (-1+x)}+\frac {b}{x^2}+\frac {-a+b}{2 (1+x)}\right ) \, dx,x,\cos (e+f x)\right )}{f}\\ &=\frac {(a+b) \log (1-\cos (e+f x))}{2 f}+\frac {(a-b) \log (1+\cos (e+f x))}{2 f}+\frac {b \sec (e+f x)}{f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.06, size = 65, normalized size = 1.20 \[ \frac {a (\log (\tan (e+f x))+\log (\cos (e+f x)))}{f}+\frac {b \sec (e+f x)}{f}+\frac {b \log \left (\sin \left (\frac {1}{2} (e+f x)\right )\right )}{f}-\frac {b \log \left (\cos \left (\frac {1}{2} (e+f x)\right )\right )}{f} \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[e + f*x]*(a + b*Sec[e + f*x]^3),x]

[Out]

-((b*Log[Cos[(e + f*x)/2]])/f) + (b*Log[Sin[(e + f*x)/2]])/f + (a*(Log[Cos[e + f*x]] + Log[Tan[e + f*x]]))/f +
 (b*Sec[e + f*x])/f

________________________________________________________________________________________

fricas [A]  time = 0.46, size = 61, normalized size = 1.13 \[ \frac {{\left (a - b\right )} \cos \left (f x + e\right ) \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) + {\left (a + b\right )} \cos \left (f x + e\right ) \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) + 2 \, b}{2 \, f \cos \left (f x + e\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)*(a+b*sec(f*x+e)^3),x, algorithm="fricas")

[Out]

1/2*((a - b)*cos(f*x + e)*log(1/2*cos(f*x + e) + 1/2) + (a + b)*cos(f*x + e)*log(-1/2*cos(f*x + e) + 1/2) + 2*
b)/(f*cos(f*x + e))

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)*(a+b*sec(f*x+e)^3),x, algorithm="giac")

[Out]

Exception raised: NotImplementedError >> Unable to parse Giac output: Unable to check sign: (2*pi/x/2)>(-2*pi/
x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)2/f*((a+b)/4*ln(ab
s(1-cos(f*x+exp(1)))/abs(1+cos(f*x+exp(1))))-a/2*ln(abs((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))+1))-b/((1-cos(
f*x+exp(1)))/(1+cos(f*x+exp(1)))-1))

________________________________________________________________________________________

maple [A]  time = 0.69, size = 48, normalized size = 0.89 \[ \frac {a \ln \left (\sin \left (f x +e \right )\right )}{f}+\frac {b}{f \cos \left (f x +e \right )}+\frac {b \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(f*x+e)*(a+b*sec(f*x+e)^3),x)

[Out]

a*ln(sin(f*x+e))/f+1/f*b/cos(f*x+e)+1/f*b*ln(csc(f*x+e)-cot(f*x+e))

________________________________________________________________________________________

maxima [A]  time = 0.35, size = 45, normalized size = 0.83 \[ \frac {{\left (a - b\right )} \log \left (\cos \left (f x + e\right ) + 1\right ) + {\left (a + b\right )} \log \left (\cos \left (f x + e\right ) - 1\right ) + \frac {2 \, b}{\cos \left (f x + e\right )}}{2 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)*(a+b*sec(f*x+e)^3),x, algorithm="maxima")

[Out]

1/2*((a - b)*log(cos(f*x + e) + 1) + (a + b)*log(cos(f*x + e) - 1) + 2*b/cos(f*x + e))/f

________________________________________________________________________________________

mupad [B]  time = 4.64, size = 72, normalized size = 1.33 \[ \frac {a\,\ln \left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )}{f}-\frac {a\,\ln \left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+1\right )}{f}-\frac {2\,b}{f\,\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2-1\right )}+\frac {b\,\ln \left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(e + f*x)*(a + b/cos(e + f*x)^3),x)

[Out]

(a*log(tan(e/2 + (f*x)/2)))/f - (a*log(tan(e/2 + (f*x)/2)^2 + 1))/f - (2*b)/(f*(tan(e/2 + (f*x)/2)^2 - 1)) + (
b*log(tan(e/2 + (f*x)/2)))/f

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a + b \sec ^{3}{\left (e + f x \right )}\right ) \cot {\left (e + f x \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)*(a+b*sec(f*x+e)**3),x)

[Out]

Integral((a + b*sec(e + f*x)**3)*cot(e + f*x), x)

________________________________________________________________________________________